General information

Touhou Toolkit (or thtk for short) is a tool for unpacking and modifying Touhou game resource files. It allows to extract and modify game sprites, textures and GUI elements; in-game texts; level scripts that specify enemy movements, attacks, etc.; demo-replays and in-game sounds. It does not allow to work with music (except for midi music in games 6-8) and save files.

Touhou Toolkit consists of four console applications: thdat handles the main dat-files, thanm processes graphics, thmsg — dialogues, thecl — scripts. The current version completely supports all danmaku Touhou games from 6 to 13. thdat is also able to process dat-files for PC-98 games, but the resulting files (other than plain txt) are not processable by thtk. The program can also work with doujin games if their file format is compatible with one of Touhou formats. However, a warning will be given if dat-file name is different from Touhou dat-file name.

Touhou Toolkit is a console application and this program provides a graphical user interface for it. First thing you should do is specify the path to your thtk folder. You may also provide a path to the folder where all your Touhou games reside. The latest version may be downloaded from a repository at Google Code. The archive also includes more detailed manuals for each of the applications.

THDAT

First stage of working with thtk is unpacking the main dat-file of the game. Choose the game in the main menu. Specify a target folder in the field "Folder". Specify the main dat-file (its name usually follows the pattern th№(e).dat. Files such as thbgm.dat and score.dat cannot be processed by thdat. In EoSD game content is spread over six files, which contain:

Button functions:

All files contained in the dat-file will be placed in the target directory. Some of them, such as demo-replays, pictures and sounds, may be accessed directly. anm-, ecl- and msg-files should be further processed by thtk applications.

THANM

Files with .anm extension contain game graphics in PNG format, as well as scripts describing its behavior. Unpacking and packing process of these files are similar to dat-files, with two differences:

thanm also provides a method to replace a single picture within the archive without repacking. Specify a picture to replace in the «Entry» field (use the «...» button; you will need to generate a desription file first), then specify a replacement file in the «File» field and press «Replace file in archive».

THMSG

msg-files contain dialogues. Those files may be named *.msg (for newer games) or msg*.dat (for older ones). Each of them unpacks into a single txt file (encoded in Shift JIS for Japanese version and ASCII for English). «Extract archive to file» unpacks the specified «Archive» into the specified «File», and «Create archive from file» performs the opposite. The program automatically generates a suggested target file name matching the name of msg-file.

THECL

ecl-files contain scripts which describe the enemy movements, attacks, etc. Their structure and handling is analogous to msg-files. The thtk page on GoogleCode has an incomplete description of the script language used in these files.

Known issues

These bugs are caused by thtk itself, not GUI: